//
//  GYMineOrderInfoViewModel.m
//  GYDemo
//
//  Created by mac on 2018/4/2.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "GYMineOrderInfoViewModel.h"
#import "Head.h"

@implementation GYMineOrderInfoModel
@end

@implementation GYMineOrderInfoListModel
@end

@implementation GYMineOrderInfoViewModel
#pragma mark - getter and setter
-(NSString *)orderCatagery
{
    if (!_orderCatagery) {
        _orderCatagery = @"0";
    }
    return _orderCatagery;
}
-(NSMutableArray *)datas
{
    if (!_datas) {
        _datas = [NSMutableArray new];
    }
    return _datas;
}
-(NSString *)orderType
{
    if (!_orderType) {
        _orderType = @"0";
    }
    return _orderType;
}
#pragma mark - method
-(void)requestDatas:(NSMutableDictionary *)para
{
    @WeakSelf;
    NSString *interface = @"getUVTOrder";
    NSString *page = para[@"page"];
    [[InterfaceManager shareInterface]requetInterface:interface withParameter:para handler:^(NSDictionary *info, InterfaceStatusModel *infoModel) {
        if (0 == infoModel.status) {
            NSArray *datalist = (NSArray*)info;
            if ([datalist isKindOfClass:[NSArray class]]) {
                NSMutableArray *arr = [NSMutableArray new];
                for (NSDictionary *dic in datalist) {
                    GYMineOrderInfoListModel *model = [GYMineOrderInfoListModel yy_modelWithJSON:dic];
                    [arr addObject:model];
                }
                [selfp setDatas:arr];
            }
        }else{
            NSMutableArray *arr;
            [selfp setDatas:arr];
            [FTIndicator showToastMessage:infoModel.message];
        }
    }];
}
#pragma mark - life
-(instancetype)init
{
    if (self = [super init]) {
        [[InterfaceManager shareInterface].specialInterfaces addObject:@"myBuyOrder"];
        [[InterfaceManager shareInterface].specialInterfaces addObject:@"mySaleOrder"];
    }
    return self;
}
@end
